﻿<views:NavigationPhoneApplicationPage x:Class="PAARC.WP7.InputPage"
                                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                                      xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                                      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                                      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                                      xmlns:views="clr-namespace:PAARC.WP7.Views"
                                      xmlns:viewModels="clr-namespace:PAARC.WP7.ViewModels"
                                      xmlns:Controls="clr-namespace:PAARC.WP7.Controls"
                                      FontFamily="{StaticResource PhoneFontFamilyNormal}"
                                      FontSize="{StaticResource PhoneFontSizeNormal}"
                                      Foreground="{StaticResource PhoneForegroundBrush}"
                                      SupportedOrientations="Landscape"
                                      Orientation="Landscape"
                                      OrientationChanged="NavigationPhoneApplicationPage_OrientationChanged"
                                      mc:Ignorable="d"
                                      d:DesignHeight="480"
                                      d:DesignWidth="800"
                                      shell:SystemTray.IsVisible="False">

    <views:NavigationPhoneApplicationPage.DataContext>
        <viewModels:InputPageViewModel />
    </views:NavigationPhoneApplicationPage.DataContext>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot"
          Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!-- Touch input area -->
        <Border Grid.RowSpan="4"
                BorderThickness="2"
                Margin="{Binding InputMarginThickness}"
                Opacity="0.3">
            <Border.Background>
                <SolidColorBrush Color="{StaticResource PhoneAccentColor}" />
            </Border.Background>
            <Border.BorderBrush>
                <SolidColorBrush Color="{StaticResource PhoneChromeColor}" />
            </Border.BorderBrush>
            <TextBlock TextWrapping="Wrap"
                       Text="Touch here"
                       Style="{StaticResource PhoneTextTitle1Style}"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center" />
        </Border>

        <Controls:GrabberControl x:Name="CustomDragGrabber"
                                 Grid.Row="2"
                                 GrabberText="DRAG"
                                 ExplanationText=""
                                 Visibility="{Binding CustomDragVisibility}"
                                 ActivationThreshold="50"
                                 IsEnabled="{Binding IsCustomDragEnabled}"
                                 IsActivated="{Binding IsCustomDragInProgress, Mode=TwoWay}"
                                 UserInteractionStartedCommand="{Binding CustomDragUserInteractionStartedCommand}"
                                 UserInteractionEndedCommand="{Binding CustomDragUserInteractionEndedCommand}"
                                 ActivatedCommand="{Binding CustomDragActivatedCommand}"
                                 DeactivatedCommand="{Binding CustomDragDeactivatedCommand}"
                                 VerticalAlignment="Bottom"
                                 HorizontalAlignment="Stretch" />

        <Controls:GrabberControl x:Name="TextInputGrabber"
                                 Grid.Row="3"
                                 GrabberText="TEXT"
                                 ExplanationText=""
                                 Visibility="{Binding TextInputVisibility}"
                                 IsEnabled="{Binding IsTextInputEnabled}"
                                 IsActivated="{Binding IsTextInputInProgress, Mode=TwoWay}"
                                 UserInteractionStartedCommand="{Binding TextInputUserInteractionStartedCommand}"
                                 UserInteractionEndedCommand="{Binding TextInputUserInteractionEndedCommand}"
                                 ActivatedCommand="{Binding TextInputActivatedCommand}"
                                 VerticalAlignment="Bottom"
                                 HorizontalAlignment="Stretch"
                                 ActivationThreshold="50" />
        <Border BorderBrush="Black"
                BorderThickness="1"
                Margin="0"
                Grid.RowSpan="4"
                Background="#BE000000"
                Visibility="{Binding WaitingForConnectionMessageVisibility, Mode=OneWay}">

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <StackPanel x:Name="TitlePanel"
                            Grid.Row="0"
                            HorizontalAlignment="Center"
                            Margin="12,75,0,28">                    
                    <StackPanel Orientation="Horizontal">
                        <TextBlock x:Name="PageTitle"
                                   Text="paarc"
                                   Margin="9,-7,0,0"
                                   Style="{StaticResource PhoneTextTitle1Style}" />
                        <Image VerticalAlignment="Bottom"
                               Source="/Content/Images/Title_Icon_transparent.png"
                               Stretch="None" />
                    </StackPanel>

                </StackPanel>

                <TextBlock Grid.Row="1"
                           TextWrapping="Wrap"
                           HorizontalAlignment="Center"
                           TextAlignment="Center"
                           VerticalAlignment="Center"
                           Style="{StaticResource PhoneTextNormalStyle}"
                           Text="{Binding WaitingForConnectionMessage, Mode=OneWay}" />
            </Grid>
        </Border>

    </Grid>

</views:NavigationPhoneApplicationPage>
